﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Cofe.Core;
using Cofe.Core.Dynamic;
using Cofe.Core.Implements;
using Cofe.Core.Property;

namespace Cofe.Media
{
    public class MediaInfo : CofeItemInfo, IMediaInfo
    {
        #region Constructor

        void init(IPropertyHost properties)
        {

        }


        public MediaInfo(IPropertyHost properties, IDynamicPropertyInterfaceProvider[] providers)
            : base(properties, providers)
        {
            init(properties);
        }

        public MediaInfo(IPropertyHost properties)
            : base(properties)
        {
            init(properties);
        }

        protected MediaInfo()
            : base()
        {

        }

        #endregion

        #region Methods

        public Task<StreamContainer> OpenReadAsync()
        {
            return Properties.Behaviors.InvokeAsync<StreamContainer>(CofeStreamProperties.OpenReadAsync);
        }

        public Task<StreamContainer> OpenWriteAsync()
        {
            return Properties.Behaviors.InvokeAsync<StreamContainer>(CofeStreamProperties.OpenWriteAsync);
        }

        #endregion

        #region Data

        #endregion

        #region Public Properties
        
        public Int32 Width
        {
            get { return Properties.Behaviors.TryGetProperty<Int32>(CofeMediaProperties.Width); }
            protected set { Properties.Behaviors.SetProperty(CofeMediaProperties.Width, value); }
        }

        public Int32 Height
        {
            get { return Properties.Behaviors.TryGetProperty<Int32>(CofeMediaProperties.Height); }
            protected set { Properties.Behaviors.SetProperty(CofeMediaProperties.Height, value); }
        }
        
        #endregion







    }
}
